package com.whstudio.common.memory.pool;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class WhstudioConf {
	private static final String BUNDLE_NAME = "dbconn";
	
	private static final String PROJECT_BUNDLE_NAME = "whstudio";

	private static ResourceBundle RESOURCE_BUNDLE = null;
	
	static{
		try{
			RESOURCE_BUNDLE = ResourceBundle.getBundle(PROJECT_BUNDLE_NAME);
		}catch(MissingResourceException miss){
			RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
		}catch(Exception e){
			e.printStackTrace();
		}
	}

	private WhstudioConf() {
		
	}

	public static String getString(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}
}
